package com.shdaow.shadow_lib_test;

import com.shadow.shadow_lib.network.ImageDownLoad;
import com.shadow.shadow_lib.network.ImageDownLoad.LoadingThreadBean;
import com.shadow.shadow_lib.network.ImageDownLoad.LoadingThreadBean.Status;
import com.shadow.shadow_lib.network.ImageLoadingmStatusChangeListener;

import android.app.Activity;
import android.os.Bundle;
import android.widget.ImageView;
import android.widget.ImageView.ScaleType;

public class TestImageDownLoad extends Activity implements
		ImageLoadingmStatusChangeListener {
	ImageView iv;

	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		iv = new ImageView(this);
		iv.setScaleType(ScaleType.MATRIX);
		setContentView(iv);
		ImageDownLoad
				.LazyImageDownLoad(
						iv,
						"http://static.uulux.com//img//2012-09-29-11-24-20_506669e4e2f8f.jpg",
						this);
	}

	@Override
	public void onmStatusChange(LoadingThreadBean threadBean) {
		if (threadBean.getmStatus() == Status.STATUS_LOADINGCOMPLETED) {
			iv.setImageBitmap(threadBean.getmBitmap());
		}
	}
}
